﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Diagnostics;

namespace ClockSync
{
    public class Neighbour
    {
        private IPAddress address;
        private Boolean isMaster;
        private int port;
        public int getPort=9000;
        public int sendPort = 9001;
        private Boolean isAlive;
        private int _RTT;
        private DateTime _time;
        private int _offset;
        private long _timeInMS;

        public DateTime RTToldTime;
        public DateTime RTTnewTime;

        public TcpHandler tcpHandler;


 
        public Neighbour(IPAddress addr,int prt)
        {
            this.address = addr;
            this.isMaster = false;
            this.port = prt;
            this.isAlive = true;
        }

        public long timeInMS
        {
            get
            {
                return this._timeInMS;
            }
            set
            {
                this._timeInMS = value;
            }
        }

        public int offset
        {
            get
            {
                return this._offset;
            }
            set
            {
                this._offset = value;
            }
        }


        public DateTime time
        {
            get
            {
                return this._time;
            }
            set
            {
                this._time = value;
            }
        }

        public int RTT
        {
            get
            {
                return this._RTT;
            }
            set
            {
                this._RTT = value;
            }
        }

        public IPAddress Address
        {
            get
            {
                return this.address;
            }
            set
            {
                this.address = value;
            }
        }

        public Boolean IsMaster
        {
            get
            {
                return this.isMaster;
            }
            set
            {
                this.isMaster = value;
            }
        }

        public int Port
        {
            get
            {
                return this.port;
            }
            set
            {
                this.port = value;
            }
        }

        public Boolean IsAlive
        {
            get
            {
                return this.isAlive;
            }
            set
            {
                this.isAlive = value;
            }
        }
    }
}
